From 038194d2a6d908641ae93c85940e3863ec2e3e93 Mon Sep 17 00:00:00 2001 From: Mat Date: Sun, 22 Mar 2020 12:13:44 +0200 Subject: Allow enderman to attack during day (#4522) --- src/Mobs/Enderman.cpp | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp index ff4ad4f69..36f12d7e6 100644 --- a/src/Mobs/Enderman.cpp +++ b/src/Mobs/Enderman.cpp @@ -113,13 +113,6 @@ void cEnderman::CheckEventSeePlayer(cChunk & a_Chunk) ASSERT(Callback.GetPlayer() != nullptr); - if (!CheckLight()) - { - // Insufficient light for enderman to become aggravated - // TODO: Teleport to a suitable location - return; - } - if (!Callback.GetPlayer()->CanMobsTarget()) { return; @@ -139,10 +132,7 @@ void cEnderman::CheckEventSeePlayer(cChunk & a_Chunk) void cEnderman::CheckEventLostPlayer(void) { super::CheckEventLostPlayer(); - if (!CheckLight()) - { - EventLosePlayer(); - } + EventLosePlayer(); } @@ -160,31 +150,6 @@ void cEnderman::EventLosePlayer() -bool cEnderman::CheckLight() -{ - int ChunkX, ChunkZ; - cChunkDef::BlockToChunk(POSX_TOINT, POSZ_TOINT, ChunkX, ChunkZ); - - // Check if the chunk the enderman is in is lit - if (!m_World->IsChunkLighted(ChunkX, ChunkZ)) - { - m_World->QueueLightChunk(ChunkX, ChunkZ); - return true; - } - - // Enderman only attack if the skylight is lower or equal to 8 - if (m_World->GetBlockSkyLight(POSX_TOINT, POSY_TOINT, POSZ_TOINT) - GetWorld()->GetSkyDarkness() > 8) - { - return false; - } - - return true; -} - - - - - void cEnderman::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { super::Tick(a_Dt, a_Chunk); -- cgit v1.2.3